package org.datacoder.geocoding.datastructures.util

import org.datacoder.geocoding.datastructures.geoshapes.*
import org.datacoder.geocoding.jurisdiction.*
import org.datacoder.util.*

class LocJurisPairComparator implements Comparator<Pair<Double, Jurisdiction>> {

    public int compare(Pair<Double, Jurisdiction> ljp1, Pair<Double, Jurisdiction> ljp2){
        double returnVal
        returnVal = ljp1.first - ljp2.first
        if(returnVal == 0){
            returnVal = ljp1.second.retrieveRealId() - ljp2.second.retrieveRealId()
        }
        if(returnVal == 0){
            return 0
        }
        return ((returnVal > 0) ? 1 : -1)
    }

}
